#include"MyList.hpp"

#include"iostream"


namespace Cherry{
  void test_Mylist1(){
    list<int> l1;
    l1.push_back(1);
    l1.push_back(2);
    l1.push_back(3);
    l1.push_back(4);
    l1.push_back(5);
    l1.push_back(6);
    
    list<int>::iterator it  = l1.begin();
    while(it!=l1.end()){
      std::cout<<*it<<" ";
      ++it;
    }
    std::cout<<std::endl;

  }

  void test_Mylist2(){
    list<int> l1;

    l1.push_back(1);
    l1.push_back(2);
    l1.push_back(3);

   list<int>::iterator it =  l1.insert(l1.begin(),666);
  
   for(const auto&i : l1){
     std::cout<<i<<" ";
   }

    std::cout<<std::endl<<*it<<std::endl;

  }

  void test_Mylist3(){
    list<int> l1;

    l1.push_back(1);
    l1.push_back(2);
    l1.push_back(3);
    l1.push_back(4);
    l1.push_back(5);

    list<int>::reverse_iterator it = l1.rbegin();
    while(it!=l1.rend()){
      std::cout<<*it<<" ";
      ++it;
    }
    std::cout<<std::endl;

  


  }
}

int main()
{

 // Cherry::test_Mylist1();
  Cherry::test_Mylist2();
  return 0;
}
